package com.app.model;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 订单记录
 * </p>
 *
 * @author yoominic
 * @since 2025-03-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("tb_payment_order")
public class PaymentOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 订单号
     */
    private String orderId;

    /**
     * 唯一标识
     */
    private String idValue;

    /**
     * 用户id
     */
    private Integer userId;

    /**
     * 经办人id
     */
    private Integer adminId;

    /**
     * 支付凭证
     */
    private String paymentVoucher;

    /**
     * 类型 1欠费 2续交
     */
    private Integer type;

    /**
     * 支付类型 1在线缴费、2扫码缴费、3线下现金缴费
     */
    private Integer paymentType;

    /**
     * 应交保证金
     */
    private BigDecimal payableDeposit;

    /**
     * 保证金
     */
    private BigDecimal depositPaid;

    /**
     * 应交房租
     */
    private BigDecimal payableRent;

    /**
     * 房租
     */
    private BigDecimal rent;

    private BigDecimal beforeAdjustment;

    private BigDecimal afterAdjustment;

    private BigDecimal calculatedArea;

    @TableField(exist = false)
    private BigDecimal actuallyPaidAmount;

    /**
     * 房租缴纳月数（交了几个月的）
     */
    private Integer rentMonth;

    /**
     * 房租欠费天数
     */
    private Integer rentLateDays;


    /**
     * 应交滞纳金
     */
    private BigDecimal payableLateFee;

    /**
     * 滞纳金
     */
    private BigDecimal lateFee;

    /**
     * 滞纳金欠费天数
     */
    private Integer lateDays;

    /**
     * 应交物业费
     */
    private BigDecimal payablePropertyFee;

    /**
     * 物业费
     */
    private BigDecimal propertyFee;

    /**
     * 物业费缴纳月数月份（交了几个月的）
     */
    private Integer propertyFeeMonth;

    /**
     * 合计应交总金额
     */
    private BigDecimal totalPayableAmount;

    /**
     * 合计缴费金额
     */
    private BigDecimal totalPaymentAmount;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    private LocalDateTime updateTime;

    /**
     * 0 未支付 1已支付
     */
    private Integer payStatus;

    /**
     * 支付时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime payTime;

    /**
     * 收据地址
     */
    private String receiptUrl;

    /**
     * 开具收据时间
     */
    private LocalDateTime receiptTime;

    /**
     * 发票地址
     */
    private String invoiceUrl;

    /**
     * 开具发票时间
     */
    private LocalDateTime invoiceTime;

    @TableField(exist = false)
    private String areaName;

    @TableField(exist = false)
    private String streetName;

    @TableField(exist = false)
    private String mphValue;

    @TableField(exist = false)
    private String payYear;

    /**
     * 支付金额
     */
    @TableField(exist = false)
    private BigDecimal paymentAmount;

    @TableField(exist = false)
    private String orderType;

    @TableField(exist = false)
    private String userNmae;

    @TableField(exist = false)
    private String userFaceUrl;

    @TableField(exist = false)
    private String leaseCertificateNumberNew;

    @TableField(exist = false)
    private String buildingNumber;

    @TableField(exist = false)
    private String unitNumber;

    @TableField(exist = false)
    private String floorLevel;

    @TableField(exist = false)
    private String roomNumber;

    @TableField(exist = false)
    private String currentTenantName;

    @TableField(exist = false)
    private String currentTenantIdCardLastFour;

    @TableField(exist = false)
    private LocalDateTime fwPayTime;

    @TableField(exist = false)
    private LocalDateTime fwUntilPayTime;

    @TableField(exist = false)
    private String realName;

    @TableField(exist = false)
    private String houseType;


}
